#pragma once
#include <curl/curl.h>
#include <string>

class HttpRequest
{
public:
	HttpRequest();
	~HttpRequest();
	bool Execute(std::string method, std::string url);
	bool Post(std::string url, const char*value);
	static void GlobalCleanup();
	static void GlobalInit();
	std::string & GetString();
	int GetErrorCode();
private:
	int  Encode(const char*src, int len,std::string &out);
	int  Decode(const char*src, int len, std::string &out);
private:
	CURL *curl;
	CURLcode code;
	std::string szbuffer;
};

